package com.wfh.config;

import dev.langchain4j.community.store.memory.chat.redis.RedisChatMemoryStore;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Title: RedisChatMemoryConfig
 * @Author wangfenghuan
 * @Package com.wfh.aigenerator.config
 * @Date 2025/8/2 14:52
 * @description:
 */
@Configuration
@ConfigurationProperties(prefix="spring.data.redis")
@Data
public class RedisChatMemoryConfig {

    private String host;
    private int port;
    private String password;
    @Bean
    public RedisChatMemoryStore redisChatMemoryStore(){
        return RedisChatMemoryStore.builder()
                .host(host)
                .port(port)
                .password(password)
                .user("default")
                .ttl(60 * 60 * 24L).build();
    }
}
